package com.minyifang.wcspf.common.config.network;

import com.minyifang.wcspf.work.model.HttpRespond;
import com.minyifang.wcspf.work.ui.goods.model.CommentBean;
import com.minyifang.wcspf.work.ui.goods.model.CommentDesc;
import com.minyifang.wcspf.work.ui.goods.model.GoodsDetailBean;
import com.minyifang.wcspf.work.ui.goods.model.MyCommentBean;
import com.minyifang.wcspf.work.ui.goods.model.PayResultBean;
import com.minyifang.wcspf.work.ui.home.model.AddToCarBean;
import com.minyifang.wcspf.work.ui.home.model.ClassBean;
import com.minyifang.wcspf.work.ui.home.model.GoodsBean;
import com.minyifang.wcspf.work.ui.home.model.GoodsBean2;
import com.minyifang.wcspf.work.ui.home.model.HomePage1Bean;
import com.minyifang.wcspf.work.ui.home.model.HotSearchBean;
import com.minyifang.wcspf.work.ui.home.model.NewsBean;
import com.minyifang.wcspf.work.ui.home.model.NewsDetailsBean;
import com.minyifang.wcspf.work.ui.home.model.RecommendGoodsBean;
import com.minyifang.wcspf.work.ui.home.model.SearchBean;
import com.minyifang.wcspf.work.ui.home.model.ShoppingCarBean;
import com.minyifang.wcspf.work.ui.home.model.SplashBean;
import com.minyifang.wcspf.work.ui.home.model.StoreListBean;
import com.minyifang.wcspf.work.ui.home.model.TakeGoodsBean;
import com.minyifang.wcspf.work.ui.user.model.CaptchaBean;
import com.minyifang.wcspf.work.ui.user.model.PriceChangeGoodsBean;
import com.minyifang.wcspf.work.ui.user.model.ProtocolBean;
import com.minyifang.wcspf.work.ui.user.model.ServiceBean;
import com.minyifang.wcspf.work.ui.user.model.StoreDetailBean;
import com.minyifang.wcspf.work.ui.user.model.TimeStampBean;
import com.minyifang.wcspf.work.ui.user.model.UploadPicBean;
import com.minyifang.wcspf.work.ui.user.model.VersionBean;
import com.minyifang.wcspf.work.ui.user.model.WeChatLoginBean;

import java.util.List;

import io.reactivex.Observable;
import io.reactivex.internal.operators.observable.ObservableError;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by xuyougen on 2018/4/11.
 */

public interface ApiService {
    @POST(ApiFactory.GET_CAPTCHA)
    Observable<HttpRespond<CaptchaBean>> getCaptcha(
            @Body RequestBody requestBody);

    @POST(ApiFactory.GET_SMS)
    Observable<HttpRespond> getSmsCode(
            @Body RequestBody requestBody);

    @POST(ApiFactory.GET_TIMESTAMPS)
    Observable<HttpRespond<TimeStampBean>> getTimeStamps(
            @Body RequestBody requestBody
    );

    @POST(ApiFactory.REGISTER)
    Observable<HttpRespond> register(@Body RequestBody requestBody);

    @POST(ApiFactory.LOGIN)
    Observable<HttpRespond> login(@Body RequestBody requestBody);

    @POST("/piApi/member/weChatLogin")
    Observable<HttpRespond<WeChatLoginBean>> WeChatLogin(@Body RequestBody requestBody);

    @POST(ApiFactory.CHECK_CAPTCHA)
    Observable<HttpRespond> checkCaptcha(@Body RequestBody requestBody);

    @POST(ApiFactory.FORGET_PWD)
    Observable<HttpRespond> forgetPwd(@Body RequestBody requestBody);

    //    ?type=1&page=1
    @GET("satinApi")
    Observable<String> getContent(@Query("type") int type, @Query("page") int page);

    @POST(ApiFactory.TAKE_GOODS)
    Observable<HttpRespond<TakeGoodsBean>> getTakeGoodsInfo(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/myCenterPage")
    Observable<HttpRespond<String>> myCenterPage(@Body RequestBody requestBody);

    @POST(ApiFactory.NEWS_LIST)
    Observable<HttpRespond<List<NewsBean>>> getNewsList(@Body RequestBody requestBody);

    //微头条详情
    @POST("/piApi/main/showMicroDetail")
    Observable<HttpRespond<NewsDetailsBean>> getNewsDetails(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_STORE_LIST)
    Observable<HttpRespond<List<StoreListBean>>> getStoreList(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_SPLASH_CONTENT)
    Observable<HttpRespond<SplashBean>> getSplashContent(@Body RequestBody requestBody);

    @POST("/piApi/commodityclass/CommodityClass")
    Observable<HttpRespond<List<ClassBean>>> getClassList(@Body RequestBody requestBody);

    @POST("/piApi/commodityDetails/commodityDetails")
    Observable<HttpRespond<GoodsDetailBean>> getGoodsDetails(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/myOrderEvaluationHead")
    Observable<HttpRespond<CommentDesc>> getCommentHeadInfo(@Body RequestBody requestBody);

    @POST("/piApi/commodityclass/commodityList")
    Observable<HttpRespond<List<GoodsBean2>>> getGoodsListByClass(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/myOrderEvaluationList")
    Observable<HttpRespond<List<CommentBean>>> getGoodsCommentList(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_HOME_DATA)
    Observable<HttpRespond<HomePage1Bean>> getHomeData(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_RECOMMEND_GOODS_LIST)
    Observable<HttpRespond<RecommendGoodsBean>> getRecommendGoodsList(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_HOT_SEARCH_LIST)
    Observable<HttpRespond<HotSearchBean>> getHotSearchList(@Body RequestBody requestBody);

    @POST(ApiFactory.GET_SEARCH_LIST)
    Observable<HttpRespond<SearchBean>> getSearchList(@Body RequestBody requestBody);

    //获取用户协议
    @POST("/piApi/member/userProtocolContent")
    Observable<HttpRespond<ProtocolBean>> getProtocal(@Body RequestBody requestBody);

    //获取门店详情
    @POST("/piApi/main/storeDetail")
    Observable<HttpRespond<StoreDetailBean>> getStoreDetail(@Body RequestBody requestBody);

    //检查版本
    @POST("/piApi/member/checkUpdate")
    Observable<HttpRespond<VersionBean>> checkVersion(@Body RequestBody requestBody);

    //保存门店
    @POST("/piApi/main/updateUserStore")
    Observable<HttpRespond> saveStore(@Body RequestBody requestBody);

    //获取商品规格
    @POST("/piApi/userInfo/getSkuForCom")
    Observable<HttpRespond<String>> getSpecification(@Body RequestBody requestBody);

    //添加商品到购物车
    @POST("/piApi/userInfo/insertShopCar")
    Observable<HttpRespond<AddToCarBean>> addToCar(@Body RequestBody requestBody);

    //获取购物车数据
    @POST("/piApi/shoppingCart/selectCart")
    Observable<HttpRespond<String>> getCarData(@Body RequestBody requestBody);

    //购物车商品数量加减
    @POST("/piApi/shoppingCart/updateShoppingCart")
    Observable<HttpRespond<AddToCarBean>> addCarNum(@Body RequestBody requestBody);

    //余额
    @POST("/piApi/userInfo/mySurplus")
    Observable<HttpRespond<String>> getBalance(@Body RequestBody requestBody);

    //余额明细
    @POST("/piApi/userInfo/mySurplusList")
    Observable<HttpRespond<String>> getBalanceDetail(@Body RequestBody requestBody);

    //修改密码
    @POST("/piApi/member/changePassword")
    Observable<HttpRespond<String>> updatePwd(@Body RequestBody requestBody);

    //关于我们
    @POST("/piApi/AboutUs")
    Observable<HttpRespond<String>> getAboutUsData(@Body RequestBody requestBody);

    //版本介绍
    @POST("/piApi/AboutUs/VersionIntroduction")
    Observable<HttpRespond<String>> getVersionIntroduction(@Body RequestBody requestBody);

    //积分
    @POST("/piApi/userInfo/myIntegral")
    Observable<HttpRespond<String>> getIntegralData(@Body RequestBody requestBody);

    //删除购物车商品
    @POST("/piApi/shoppingCart/delAllCart")
    Observable<HttpRespond<String>> delCarGoods(@Body RequestBody requestBody);

    //结算合计
    @POST("/piApi/shoppingCart/checkOnCom")
    Observable<HttpRespond<String>> calculateMoney(@Body RequestBody requestBody);

    //收藏列表
    @POST("/piApi/userInfo/myCommodityDollection")
    Observable<HttpRespond<String>> getCollectionList(@Body RequestBody requestBody);

    //删除收藏
    @POST("/piApi/userInfo/deleteCollection")
    Observable<HttpRespond<String>> delCollection(@Body RequestBody requestBody);

    //添加收藏
    @POST("/piApi/userInfo/updateCollection")
    Observable<HttpRespond<String>> collectionGoods(@Body RequestBody requestBody);

    //获取最新消息
    @POST("/piApi/userInfo/newMyMessage")
    Observable<HttpRespond<String>> getMessageData(@Body RequestBody requestBody);

    //获取消息列表
    @POST("/piApi/userInfo/myMessage")
    Observable<HttpRespond<String>> getMessageList(@Body RequestBody requestBody);

    //获取全部门店信息
    @POST("/piApi/userInfo/getStoreNameId")
    Observable<HttpRespond<String>> getAllStoreList(@Body RequestBody requestBody);

    //获取小区信息
    @POST("/piApi/userInfo/getStoreArea")
    Observable<HttpRespond<String>> getXiaoQuList(@Body RequestBody requestBody);

    //新增收货地址
    @POST("/piApi/userInfo/insertMyAddress")
    Observable<HttpRespond<String>> saveAddress(@Body RequestBody requestBody);

    //获取地址
    @POST("/piApi/userInfo/myAddress")
    Observable<HttpRespond<String>> getAddressList(@Body RequestBody requestBody);

    //删除地址
    @POST("/piApi/userInfo/deleteMyAddress")
    Observable<HttpRespond<String>> delAddress(@Body RequestBody requestBody);

    //设置默认地址
    @POST("/piApi/userInfo/changeDefaultAddress")
    Observable<HttpRespond<String>> setDefAddress(@Body RequestBody requestBody);

    //编辑地址
    @POST("/piApi/userInfo/updateMyAddress")
    Observable<HttpRespond<String>> editAddress(@Body RequestBody requestBody);

    //上传图片
    @Multipart
    @POST("/piApi/upload/filesUpload")
    Observable<HttpRespond<List<UploadPicBean>>> uploadImage(@Part("token") RequestBody token, @Part("client") RequestBody client, @Part MultipartBody.Part image_part);

    //获取评论里的商品信息
    @POST("/piApi/userInfo/getOrderCommodity")
    Observable<HttpRespond<String>> getCommitOrderInfo(@Body RequestBody requestBody);

    //添加评论
    @POST("/piApi/userInfo/insertCommodityEvaluation")
    Observable<HttpRespond> addComment(@Body RequestBody requestBody);

    //我的评论头信息
    @POST("/piApi/userInfo/myEvaluationListHead")
    Observable<HttpRespond<CommentDesc>> getMyCommentHeadInfo(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/myEvaluationList")
    Observable<HttpRespond<String>> getMyCommentList(@Body RequestBody requestBody);

    //获取订单页相关数据
    @POST("/piApi/submitOrder/getInfo")
    Observable<HttpRespond<String>> getOrderData(@Body RequestBody requestBody);

    //创建订单
    @POST("/piApi/submitOrder/addOrder")
    Observable<HttpRespond<String>> createOrder(@Body RequestBody requestBody);

    //获取支付页面信息
    @POST("/piApi/submitOrder/getPayInfo")
    Observable<HttpRespond<String>> getPayData(@Body RequestBody requestBody);

    //发起支付
    @POST("/piApi/submitOrder/paymentOrder")
    Observable<HttpRespond<String>> pay(@Body RequestBody requestBody);

    //发起支付(支付宝)
    @POST("/piApi/submitOrder/alipayCreateOrder")
    Observable<HttpRespond<String>> payAli(@Body RequestBody requestBody);

    //发起支付(微信)
    @POST("/piApi/submitOrder/wechatCreateOrder")
    Observable<HttpRespond<String>> payWeChat(@Body RequestBody requestBody);

    //支付结果
    @POST("/piApi/submitOrder/successInfo")
    Observable<HttpRespond<PayResultBean>> getPayRes(@Body RequestBody requestBody);

    //获取我的订单
    @POST("/piApi/userInfo/myOrderList")
    Observable<HttpRespond<String>> getOrderList(@Body RequestBody requestBody);

    //获取订单详情
    @POST("/piApi/userInfo/OrderInfo")
    Observable<HttpRespond<String>> getOrderDetails(@Body RequestBody requestBody);

    //选择附件算钱
    @POST("/piApi/submitOrder/calculationAmount")
    Observable<HttpRespond<String>> calculateOrderMoney(@Body RequestBody requestBody);

    //取消订单
    @POST("/piApi/submitOrder/cancellationOrder")
    Observable<HttpRespond<String>> cancelOrder(@Body RequestBody requestBody);

    //确认收货取货
    @POST("/piApi/submitOrder/confirmReceipt")
    Observable<HttpRespond<String>> confirmOrder(@Body RequestBody requestBody);

    //退货界面数据
    @POST("/piApi/userInfo/returnOrderInfo")
    Observable<HttpRespond<String>> getRefoundData(@Body RequestBody requestBody);

    //支付成功后修改订单状态
    @POST("/piApi/submitOrder/paySuccess")
    Observable<HttpRespond<String>> paySuccess(@Body RequestBody requestBody);

    //退货算钱
    @POST("/piApi/userInfo/returnMoney")
    Observable<HttpRespond<String>> calculateRefoundMoney(@Body RequestBody requestBody);

    //退款提交信息
    @POST("/piApi/userInfo/insertReturnOrder")
    Observable<HttpRespond<String>> commitRefundInfo(@Body RequestBody requestBody);

    @POST("/piApi/main/todayActivity")
    Observable<HttpRespond<List<GoodsBean>>> getSpecialSaleGoodsList(@Body RequestBody requestBody);

    //退款提交信息
    @POST("/piApi/userInfo/getCheckRecordList")
    Observable<HttpRespond<String>> getCheckRecordList(@Body RequestBody requestBody);

    //签到
    @POST("/piApi/userInfo/insertCheckRecord")
    Observable<HttpRespond<String>> insertCheckRecord(@Body RequestBody requestBody);

    //获取个人信息，用于修改
    @POST("/piApi/userInfo/userInformation")
    Observable<HttpRespond<String>> userInformation(@Body RequestBody requestBody);

    //修改个人信息
    @POST("/piApi/userInfo/updateUserInformation")
    Observable<HttpRespond<String>> updateUserInformation(@Body RequestBody requestBody);

    //获取优惠券数量
    @POST("/piApi/userInfo/couponSum")
    Observable<HttpRespond<String>> getCouponNum(@Body RequestBody requestBody);

    //获取优惠券
    @POST("/piApi/userInfo/availableCoupon")
    Observable<HttpRespond<String>> getCouponList(@Body RequestBody requestBody);

    //删除优惠券
    @POST("/piApi/userInfo/deleteAlreadyUsedCoupon")
    Observable<HttpRespond<String>> deleteCoupon(@Body RequestBody requestBody);

    //客服
    @POST("/piApi/main/CustomerService")
    Observable<HttpRespond<ServiceBean>> getServiceData(@Body RequestBody requestBody);

    //获取退货详情
    @POST("/piApi/userInfo/getReturnOrderDetails")
    Observable<HttpRespond<String>> getRefundDetails(@Body RequestBody requestBody);

    @POST("/piApi/main/complain")
    Observable<HttpRespond<String>> commitComplain(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/depositInfo")
    Observable<HttpRespond<String>> getDepositDetails(@Body RequestBody requestBody);

    @POST("/piApi/shoppingCart/getShoppingCartNumAndPrice")
    Observable<HttpRespond<ShoppingCarBean>> getCarNum(@Body RequestBody requestBody);

    @POST("/piApi/commodityclass/downPriceCom")
    Observable<HttpRespond<List<PriceChangeGoodsBean>>> getPriceChangeGoods(@Body RequestBody requestBody);

    @POST("/piApi/userInfo/againOrder")
    Observable<HttpRespond> buyAgain(@Body RequestBody requestBody);
}


